home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / showcaps.arc / SHOWCAPS.ASM next >
Encoding:
Assembly Source File  |  1986-12-22  |  1.6 KB  |  86 lines

  1. PAGE    60,132
  2.  
  3. ;    SHOWCAPS.ASM
  4.  
  5.  
  6. CSEG    SEGMENT
  7.     ASSUME    CS:CSEG
  8.     ORG    100H
  9.  
  10. START    PROC    NEAR
  11.     JMP    MAKERES
  12.  
  13. OLD_INT8    DD    ?    ; Save old INT 8 -- timer
  14.  
  15. SHOWCAPS:
  16.     PUSH    AX        ; Save registers to be used
  17.     PUSH    CX
  18.     PUSH    DS
  19.  
  20.     CLI            ; Disable interrupts
  21.     MOV    AH,2        ; Get current keyboard status
  22.     INT    16H        ; Keyboard I/O
  23.  
  24.     AND    AL,40H        ; Has Caps Lock been toggled to upper case?
  25.     JNZ    UC        ; If so then set cursor big
  26. LC:                ; Else set cursor small
  27.     INT    11H        ; Get equipment
  28.  
  29.     AND    AX,30H        ; Is the CRT monochrome?
  30. ;    CMP    AX,30H        ; Is the CRT monochrome?
  31.     JE    LC_MONO
  32. LC_COLOR:
  33.     MOV    CX,0607H    ; Set cursor for lower case color
  34.     JMP    DO_IT
  35. LC_MONO:
  36.     MOV    CX,0B0CH    ; Set cursor for lower case monochrome
  37.     JMP    DO_IT
  38. UC:
  39.     INT    11H        ; Get equipment
  40.  
  41.     AND    AX,30H
  42.     CMP    AX,30H        ; Is the CRT monochrome?
  43.     JE    UC_MONO
  44. UC_COLOR:
  45.     MOV    CX,0007H    ; Set cursor for upper case color
  46.     JMP    DO_IT
  47. UC_MONO:
  48.     MOV    CX,010BH    ; Set cursor for upper case monochrome
  49. DO_IT:
  50.     MOV    AH,1        ; Set cursor
  51.     INT    10H
  52. DONE:
  53.     STI            ; Enable interrupts again
  54.     POP    DS
  55.     POP    CX
  56.     POP    AX
  57.  
  58.     JMP    CS:[OLD_INT8]    ; Continue with normal timer interrupt
  59. ENDRES:
  60.  
  61. MAKERES:
  62.     PUSH    CS
  63.     POP    DS
  64.     ASSUME    DS:CSEG
  65.  
  66.     MOV    AX,3508H            ; Get vector for timer
  67.     INT    21H                ; interrupt function
  68.  
  69.     MOV    WORD PTR [OLD_INT8],BX        ; Keep old pointers
  70.     MOV    WORD PTR [OLD_INT8+2],ES
  71.  
  72.     MOV    AX,2508H            ; Set vector 8 to
  73.     MOV    DX,OFFSET SHOWCAPS        ; point to SHOWCAPS
  74.     INT    21H
  75.     
  76.     MOV    DX,OFFSET ENDRES
  77.     MOV    CL,4        ; Calculate size of code
  78.     SHR    DX,CL        ; to be resident
  79.     INC    DX
  80.     MOV    AX,3100H    ; Make the function stay resident
  81.     INT    21H
  82.  
  83. START    ENDP
  84. CSEG    ENDS
  85.     END    START
  86.